<div style="background: #c0d6f0; padding:5px 0 5px 10px;"><h2>Thông Tin Tài Khoản</h2></div>
<?php
	$bt=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
	if($bt!="")
	{
	$email=$_SESSION["email"];
	$hoten=isset($_POST["hoten"])?$_POST["hoten"]:"";
	$diachi=isset($_POST["diachi"])?$_POST["diachi"]:"";
	//$email=isset($_POST["email"])?$_POST["email"]:"";
	$dienthoai=isset($_POST["dienthoai"])?$_POST["dienthoai"]:"";
	if($hoten!="" and $dienthoai!="" and $diachi!="")
	{	
		$sql="update khachhang set tenkh='$hoten',sdt='$dienthoai',diachi='$diachi' where email='$email'";
		$kq=mysql_query($sql);
		echo "<script>alert('Quý khách đã thay đổi thông tin cá nhân thành công! ');window.location='index.php?action=taikhoan';</script>";
	}
	else
		echo "<script>alert('Quý khách đã thay đổi thông tin cá nhân KHÔNG thành công! ');window.location='index.php?action=taikhoan';</script>";
	}
?>

<?php
$email=$_SESSION["email"];
$sql="select * from khachhang where email='$email'";
$kq=mysql_query($sql);
$r=mysql_fetch_array($kq);
$hoten=$r["tenkh"];$email=$r["email"];$diachi=$r["diachi"];$dienthoai=$r["sdt"];
?>

<form method="post" action="index.php" id="ddd">
<input type="hidden" name="action" value="taikhoan" />
<input type="hidden" name="ten" value="tttk" />
        <table width="724px" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" style="margin:10px auto 0 0px;">
          <tr onmouseover="style.background='#c8dbf0'" onmouseout="style.background='#FFFFFF'">            
            <td height="30px" width="100px"style="padding-left:70px">Họ tên:</td>
     		<td style="padding-left:15px;">
       		
       		    <input type="text" name="hoten" style="width:220px" value="<?php echo "$hoten"; ?>" class="required"/>
   		     </td>            
          </tr>
          <tr onmouseover="style.background='#c8dbf0'" onmouseout="style.background='#FFFFFF'">   
            <td height="30" width="100px" style="padding-left:70px">Địa chỉ:</td>
 			<td style="padding-left:15px" valign="top" align="left">              
                <textarea name="diachi" rows="6" style="width:220px"  class="required"><?php echo "$diachi"; ?></textarea>
             </td>            
          </tr>       
          <tr bgcolor="#f9f9f9" onmouseover="style.background='#c8dbf0'" onmouseout="style.background='#F9F9F9'">            
            <td height="30" width="100px" style="padding-left:70px">Điện thoại</td>
 			<td style="padding-left:15px">
                <input type="text" name="dienthoai" style="width:220px" value="<?php echo "$dienthoai"; ?>" class="required" minlength=7 maxlength=11/>
             </td>            
          </tr>
          
          <tr>
            <td height="35" colspan="2" bgcolor="#2d94ff">
                <input type="submit" name="submit" value="Sửa"  style="height:30px; width:70px; margin-left:210px;">
	<input type="reset" value="Nhập lại"  style="height:30px; width:70px;" >	
            </td>
          </tr>
        </table>
</form>

